package cn.apthink.controller;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 响应基础类
 * @author David唐
 * @createdate 2024年1月18日
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="响应基础包")
public class BaseResult {
	@ApiModelProperty(name="errorid", value="服务响应errorid：0-成功 >0-ERROR")
	private int errorid;
	@ApiModelProperty(name="message", value="响应结果文本消息")
	private String message;

	public final static BaseResult success(String message) {
		return new BaseResult(0, message);
	}

	public final static BaseResult error(String message) {
		return new BaseResult(100, message);
	}

	public final static BaseResult error(int errorId, String message) {
		return new BaseResult(errorId, message);
	}
}
